﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.IO;
using System.Linq;
using System.Net.Cache;
using System.Threading;

namespace NFinal.Common.TaskLogger
{
    public class TaskLoggerFactory
    {
        public static ITaskLogger GetTaskLogger(object context,string name)
        {
            if (context == null)
            {
                return new ConsoleTaskLogger(name);
            }
            else
            {
                if (context is TextWriter)
                {
                    return new TextWriterTaskLogger((TextWriter)context,name);
                }
                else
                {
                    throw new ArgumentException();
                }
            }
        }
    }  
}
